Fixed spacing
authorumherirrender <umherirrender_de.wp@web.de>
Mon, 21 Jul 2014 12:47:42 +0000 (14:47 +0200)
committerumherirrender <umherirrender_de.wp@web.de>
Thu, 24 Jul 2014 09:53:04 +0000 (11:53 +0200)
- Removed spaces after not operator (!)
- Removed spaces inside array index
- use tab as indent instead of spaces
- Add newline at end of file
- Removed spaces after casts

Change-Id: I9ba17c4385fcb43d38998d45f89cf42952bc791b

35 files changed:
includes/AjaxDispatcher.php
includes/AjaxResponse.php
includes/GlobalFunctions.php
includes/HtmlFormatter.php
includes/HttpFunctions.php
includes/Import.php
includes/Linker.php
includes/OutputPage.php
includes/Preferences.php
includes/Setup.php
includes/UserMailer.php
includes/changes/EnhancedChangesList.php
includes/config/GlobalVarConfig.php
includes/deferred/ViewCountUpdate.php
includes/filebackend/SwiftFileBackend.php
includes/filerepo/file/File.php
includes/installer/WebInstallerPage.php
includes/media/Bitmap.php
includes/media/DjVu.php
includes/page/Article.php
includes/page/WikiFilePage.php
includes/page/WikiPage.php
includes/resourceloader/ResourceLoaderStartUpModule.php
includes/search/SearchHighlighter.php
includes/specials/SpecialWhatlinkshere.php
languages/Language.php
languages/messages/MessagesFrp.php
tests/parser/parserTest.inc
tests/phpunit/includes/StatusTest.php
tests/phpunit/includes/api/ApiTestCase.php
tests/phpunit/includes/exception/MWExceptionHandlerTest.php
tests/phpunit/includes/media/DjVuTest.php
tests/phpunit/includes/specials/SpecialMyLanguageTest.php
tests/phpunit/structure/ResourcesTest.php
tests/testHelpers.inc

index c9ca128..dde8467 100644 (file)
@@ -55,7 +55,7 @@ class AjaxDispatcher {
 
                $this->mode = "";
 
-               if ( ! empty( $_GET["rs"] ) ) {
+               if ( !empty( $_GET["rs"] ) ) {
                        $this->mode = "get";
                }
 
@@ -66,7 +66,7 @@ class AjaxDispatcher {
                switch ( $this->mode ) {
                        case 'get':
                                $this->func_name = isset( $_GET["rs"] ) ? $_GET["rs"] : '';
-                               if ( ! empty( $_GET["rsargs"] ) ) {
+                               if ( !empty( $_GET["rsargs"] ) ) {
                                        $this->args = $_GET["rsargs"];
                                } else {
                                        $this->args = array();
@@ -74,7 +74,7 @@ class AjaxDispatcher {
                                break;
                        case 'post':
                                $this->func_name = isset( $_POST["rs"] ) ? $_POST["rs"] : '';
-                               if ( ! empty( $_POST["rsargs"] ) ) {
+                               if ( !empty( $_POST["rsargs"] ) ) {
                                        $this->args = $_POST["rsargs"];
                                } else {
                                        $this->args = array();
@@ -105,7 +105,7 @@ class AjaxDispatcher {
 
                wfProfileIn( __METHOD__ );
 
-               if ( ! in_array( $this->func_name, $wgAjaxExportList ) ) {
+               if ( !in_array( $this->func_name, $wgAjaxExportList ) ) {
                        wfDebug( __METHOD__ . ' Bad Request for unknown function ' . $this->func_name . "\n" );
 
                        wfHttpError(
index a3808a5..41cbd24 100644 (file)
@@ -132,7 +132,7 @@ class AjaxResponse {
         * @param string $text
         */
        function addText( $text ) {
-               if ( ! $this->mDisabled && $text ) {
+               if ( !$this->mDisabled && $text ) {
                        $this->mText .= $text;
                }
        }
@@ -141,7 +141,7 @@ class AjaxResponse {
         * Output text
         */
        function printText() {
-               if ( ! $this->mDisabled ) {
+               if ( !$this->mDisabled ) {
                        print $this->mText;
                }
        }
index 6850734..8bcd56e 100644 (file)
@@ -1873,7 +1873,7 @@ function wfReportTime() {
        $responseTime = round( ( microtime( true ) - $wgRequestTime ) * 1000 );
        $reportVars = array( 'wgBackendResponseTime' => $responseTime );
        if ( $wgShowHostnames ) {
-               $reportVars[ 'wgHostname' ] = wfHostname();
+               $reportVars['wgHostname'] = wfHostname();
        }
        return Skin::makeVariablesScript( $reportVars );
 }
index ebced70..02c6c5e 100644 (file)
@@ -237,7 +237,7 @@ class HtmlFormatter {
        private function fixLibXML( $html ) {
                wfProfileIn( __METHOD__ );
                static $replacements;
-               if ( ! $replacements ) {
+               if ( !$replacements ) {
                        // We don't include rules like '&#34;' => '&amp;quot;' because entities had already been
                        // normalized by libxml. Using this function with input not sanitized by libxml is UNSAFE!
                        $replacements = new ReplacementArray( array(
index c9dd0c0..018c867 100644 (file)
@@ -772,7 +772,7 @@ class CurlHttpRequest extends MWHttpRequest {
 
                if ( $this->followRedirects && $this->canFollowRedirects() ) {
                        wfSuppressWarnings();
-                       if ( ! curl_setopt( $curlHandle, CURLOPT_FOLLOWLOCATION, true ) ) {
+                       if ( !curl_setopt( $curlHandle, CURLOPT_FOLLOWLOCATION, true ) ) {
                                wfDebug( __METHOD__ . ": Couldn't set CURLOPT_FOLLOWLOCATION. " .
                                        "Probably safe_mode or open_basedir is set.\n" );
                                // Continue the processing. If it were in curl_setopt_array,
index 6aab157..d86a640 100644 (file)
@@ -533,7 +533,7 @@ class WikiImporter {
        private function handleSiteInfo() {
                // Site info is useful, but not actually used for dump imports.
                // Includes a quick short-circuit to save performance.
-               if ( ! $this->mSiteInfoCallback ) {
+               if ( !$this->mSiteInfoCallback ) {
                        $this->reader->next();
                        return true;
                }
index 1991694..3f31d1b 100644 (file)
@@ -937,7 +937,7 @@ class Linker {
                $query = '', $unused1 = '', $unused2 = '', $time = false
        ) {
                global $wgEnableUploads, $wgUploadMissingFileUrl, $wgUploadNavigationUrl;
-               if ( ! $title instanceof Title ) {
+               if ( !$title instanceof Title ) {
                        return "<!-- ERROR -->" . htmlspecialchars( $label );
                }
                wfProfileIn( __METHOD__ );
index fbdde64..b9cd6e8 100644 (file)
@@ -3582,7 +3582,7 @@ $templates
                        $group = $module->getGroup();
                        // Modules in groups different than the ones listed on top (see $styles assignment)
                        // will be placed in the "other" group
-                       $styles[ isset( $styles[$group] ) ? $group : 'other' ][] = $name;
+                       $styles[isset( $styles[$group] ) ? $group : 'other'][] = $name;
                }
 
                // We want site, private and user styles to override dynamically added
index b4bb6de..0cc926d 100644 (file)
@@ -1022,7 +1022,7 @@ class Preferences {
         */
        static function searchPreferences( $user, IContextSource $context, &$defaultPreferences ) {
                foreach ( MWNamespace::getValidNamespaces() as $n ) {
-                       $defaultPreferences[ 'searchNs' . $n ] = array(
+                       $defaultPreferences['searchNs' . $n] = array(
                                'type' => 'api',
                        );
                }
index 040aba5..d551e76 100644 (file)
@@ -488,7 +488,7 @@ if ( !$wgHTCPRouting && $wgHTCPMulticastAddress ) {
 }
 
 // Back compatibility for $wgRateLimitLog deprecated with 1.23
-if ( $wgRateLimitLog && ! array_key_exists( 'ratelimit', $wgDebugLogGroups ) ) {
+if ( $wgRateLimitLog && !array_key_exists( 'ratelimit', $wgDebugLogGroups ) ) {
        $wgDebugLogGroups['ratelimit'] = $wgRateLimitLog;
 }
 
index 25be921..913b430 100644 (file)
@@ -397,7 +397,7 @@ class UserMailer {
                        if ( self::$mErrorString ) {
                                wfDebug( "Error sending mail: " . self::$mErrorString . "\n" );
                                return Status::newFatal( 'php-mail-error', self::$mErrorString );
-                       } elseif ( ! $sent ) {
+                       } elseif ( !$sent ) {
                                // mail function only tells if there's an error
                                wfDebug( "Unknown error sending mail\n" );
                                return Status::newFatal( 'php-mail-error-unknown' );
index 0c073c6..b471ea5 100644 (file)
@@ -40,7 +40,7 @@ class EnhancedChangesList extends ChangesList {
                        // @todo: deprecate constructing with Skin
                        $context = $obj->getContext();
                } else {
-                       if ( ! $obj instanceof IContextSource ) {
+                       if ( !$obj instanceof IContextSource ) {
                                throw new MWException( 'EnhancedChangesList must be constructed with a '
                                        . 'context source or skin.' );
                        }
index 0d7f3f0..175a76e 100644 (file)
@@ -72,7 +72,7 @@ class GlobalVarConfig implements Config {
                if ( !array_key_exists( $var, $GLOBALS ) ) {
                        throw new ConfigException( __METHOD__ . ": undefined variable: '$var'" );
                }
-               return $GLOBALS[ $var ];
+               return $GLOBALS[$var];
        }
 
        /**
@@ -83,6 +83,6 @@ class GlobalVarConfig implements Config {
         * @param mixed $value value to set
         */
        protected function setWithPrefix( $prefix, $name, $value ) {
-               $GLOBALS[ $prefix . $name ] = $value;
+               $GLOBALS[$prefix . $name] = $value;
        }
 }
index 901ef9f..8282295 100644 (file)
@@ -51,7 +51,7 @@ class ViewCountUpdate implements DeferrableUpdate {
                if ( $wgHitcounterUpdateFreq <= 1 || $dbw->getType() == 'sqlite' ) {
                        $id = $this->id;
                        $method = __METHOD__;
-                       $dbw->onTransactionIdle( function() use ( $dbw, $id, $method ) {
+                       $dbw->onTransactionIdle( function () use ( $dbw, $id, $method ) {
                                try {
                                        $dbw->update( 'page',
                                                array( 'page_counter = page_counter + 1' ),
index 9ef23f8..9af53c3 100644 (file)
@@ -1521,7 +1521,7 @@ class SwiftFileBackend extends FileBackendStore {
                                        'mtime' => $this->convertSwiftDate( $rhdrs['last-modified'], TS_MW ),
                                        // Empty objects actually return no content-length header in Ceph
                                        'size'  => isset( $rhdrs['content-length'] ) ? (int)$rhdrs['content-length'] : 0,
-                                       'sha1'  => $rhdrs[ 'x-object-meta-sha1base36'],
+                                       'sha1'  => $rhdrs['x-object-meta-sha1base36'],
                                        // Note: manifiest ETags are not an MD5 of the file
                                        'md5'   => ctype_xdigit( $rhdrs['etag'] ) ? $rhdrs['etag'] : null,
                                        'xattr' => array( 'metadata' => $metadata, 'headers' => $headers )
index e970e38..260fde1 100644 (file)
@@ -1178,7 +1178,7 @@ abstract class File {
                        return false;
                }
 
-               $this->tmpBucketedThumbCache[ $bucket ] = $tmpFile->getPath();
+               $this->tmpBucketedThumbCache[$bucket] = $tmpFile->getPath();
                // For the caching to work, we need to make the tmp file survive as long as
                // this object exists
                $tmpFile->bind( $this );
@@ -1204,8 +1204,8 @@ abstract class File {
                        }
 
                        // Try to avoid reading from storage if the file was generated by this script
-                       if ( isset( $this->tmpBucketedThumbCache[ $bucket ] ) ) {
-                               $tmpPath = $this->tmpBucketedThumbCache[ $bucket ];
+                       if ( isset( $this->tmpBucketedThumbCache[$bucket] ) ) {
+                               $tmpPath = $this->tmpBucketedThumbCache[$bucket];
 
                                if ( file_exists( $tmpPath ) ) {
                                        return array(
index c26028d..1c3be75 100644 (file)
@@ -1048,7 +1048,7 @@ class WebInstallerOptions extends WebInstallerPage {
                                                'rawtext' => $skin,
                                                'value' => $this->getVar( "skin-$skin", true ), // all found skins enabled by default
                                        ) ) .
-                                       '<div class="config-skins-use-as-default">' . $radioButtons[ strtolower( $skin ) ] . '</div>' .
+                                       '<div class="config-skins-use-as-default">' . $radioButtons[strtolower( $skin )] . '</div>' .
                                        '</div>';
                        }
                } else {
index c0d9b71..b2802dd 100644 (file)
@@ -329,7 +329,7 @@ class BitmapHandler extends ImageHandler {
                $animation_post = array();
                $decoderHint = array();
                if ( $params['mimeType'] == 'image/jpeg' ) {
-                       $qualityVal = isset( $params['quality'] ) ? (string) $params['quality'] : null;
+                       $qualityVal = isset( $params['quality'] ) ? (string)$params['quality'] : null;
                        $quality = array( '-quality', $qualityVal ?: '80' ); // 80%
                        # Sharpening, see bug 6193
                        if ( ( $params['physicalWidth'] + $params['physicalHeight'] )
@@ -458,7 +458,7 @@ class BitmapHandler extends ImageHandler {
                                        list( $radius, $sigma ) = explode( 'x', $wgSharpenParameter );
                                        $im->sharpenImage( $radius, $sigma );
                                }
-                               $qualityVal = isset( $params['quality'] ) ? (string) $params['quality'] : null;
+                               $qualityVal = isset( $params['quality'] ) ? (string)$params['quality'] : null;
                                $im->setCompressionQuality( $qualityVal ?: 80 );
                        } elseif ( $params['mimeType'] == 'image/png' ) {
                                $im->setCompressionQuality( 95 );
index 299252b..daeb475 100644 (file)
@@ -73,7 +73,7 @@ class DjVuHandler extends ImageHandler {
         * @return bool
         */
        function validateParam( $name, $value ) {
-               if ( $name === 'page' && trim( $value ) !== (string) intval( $value ) ) {
+               if ( $name === 'page' && trim( $value ) !== (string)intval( $value ) ) {
                        // Extra junk on the end of page, probably actually a caption
                        // e.g. [[File:Foo.djvu|thumb|Page 3 of the document shows foo]]
                        return false;
index 2f27826..3f77195 100644 (file)
@@ -1240,7 +1240,7 @@ class Article implements Page {
 
                $hookResult = wfRunHooks( 'BeforeDisplayNoArticleText', array( $this ) );
 
-               if ( ! $hookResult ) {
+               if ( !$hookResult ) {
                        return;
                }
 
index 87cc7ba..bfcd4c3 100644 (file)
@@ -201,7 +201,7 @@ class WikiFilePage extends WikiPage {
                $title = $this->mTitle;
                $file = $this->mFile;
 
-               if ( ! $file instanceof LocalFile ) {
+               if ( !$file instanceof LocalFile ) {
                        wfDebug( __CLASS__ . '::' . __METHOD__ . " is not supported for this file\n" );
                        return TitleArray::newFromResult( new FakeResultWrapper( array() ) );
                }
index fc269d8..8d0f0af 100644 (file)
@@ -1603,7 +1603,7 @@ class WikiPage implements Page, IDBAccessObject {
                                $oldContent = $rev->getContent();
                        }
 
-                       if ( ! $oldContent ) {
+                       if ( !$oldContent ) {
                                wfDebug( __METHOD__ . ": no page text\n" );
                                wfProfileOut( __METHOD__ );
                                return null;
@@ -2780,7 +2780,7 @@ class WikiPage implements Page, IDBAccessObject {
                }
 
                $user = is_null( $user ) ? $wgUser : $user;
-               if ( ! wfRunHooks( 'ArticleDelete', array( &$this, &$user, &$reason, &$error, &$status ) ) ) {
+               if ( !wfRunHooks( 'ArticleDelete', array( &$this, &$user, &$reason, &$error, &$status ) ) ) {
                        if ( $status->isOK() ) {
                                // Hook aborted but didn't set a fatal status
                                $status->fatal( 'delete-hook-aborted' );
index 56eb0a0..87782ec 100644 (file)
@@ -233,7 +233,7 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule {
                                );
                        }
 
-                       $registryData[ $name ] = array(
+                       $registryData[$name] = array(
                                'version' => $mtime,
                                'dependencies' => $module->getDependencies(),
                                'group' => $module->getGroup(),
index b8b2bae..7923699 100644 (file)
@@ -117,7 +117,7 @@ class SearchHighlighter {
                                                }
                                                $offset = $endMatches[0][1] + strlen( $endMatches[0][0] );
                                        }
-                                       if ( ! $found ) {
+                                       if ( !$found ) {
                                                // couldn't find appropriate closing tag, skip
                                                $this->splitAndAdd( $textExt, $count, substr( $text, $start, strlen( $matches[0][0] ) ) );
                                                $start += strlen( $matches[0][0] );
@@ -184,7 +184,7 @@ class SearchHighlighter {
                        $succ = true;
                        // check if first text contains all terms
                        foreach ( $terms as $term ) {
-                               if ( ! preg_match( "/$patPre" . $term . "$patPost/ui", $firstText ) ) {
+                               if ( !preg_match( "/$patPre" . $term . "$patPost/ui", $firstText ) ) {
                                        $succ = false;
                                        break;
                                }
@@ -194,7 +194,7 @@ class SearchHighlighter {
                                $offsets[$first] = 0;
                        }
                }
-               if ( ! $snippets ) {
+               if ( !$snippets ) {
                        // match whole query on text
                        $this->process( $pat1, $textExt, $left, $contextchars, $snippets, $offsets );
                        // match whole query on templates/tables/images
@@ -279,7 +279,7 @@ class SearchHighlighter {
 
                $processed = array();
                foreach ( $terms as $term ) {
-                       if ( ! isset( $processed[$term] ) ) {
+                       if ( !isset( $processed[$term] ) ) {
                                $pat3 = "/$patPre(" . $term . ")$patPost/ui"; // highlight word
                                $extract = preg_replace( $pat3,
                                        "\\1<span class='searchmatch'>\\2</span>\\3", $extract );
@@ -528,7 +528,7 @@ class SearchHighlighter {
                        }
                        ++$lineno;
                        $m = array();
-                       if ( ! preg_match( $pat1, $line, $m ) ) {
+                       if ( !preg_match( $pat1, $line, $m ) ) {
                                continue;
                        }
                        --$contextlines;
index 694bc83..81d40cc 100644 (file)
@@ -151,7 +151,7 @@ class SpecialWhatLinksHere extends IncludableSpecialPage {
                        $conds['pagelinks'][] = 'rd_from is NOT NULL';
                }
 
-               $queryFunc = function( $dbr, $table, $fromCol ) use ( $conds, $target, $limit ) {
+               $queryFunc = function ( $dbr, $table, $fromCol ) use ( $conds, $target, $limit ) {
                        global $wgUseLinkNamespaceDBFields;
                        // Read an extra row as an at-end check
                        $queryLimit = $limit + 1;
index 88d0f23..8b41b4e 100644 (file)
@@ -3125,7 +3125,7 @@ class Language {
         */
        function getMagic( $mw ) {
                // Saves a function call
-               if ( ! $this->mMagicHookDone ) {
+               if ( !$this->mMagicHookDone ) {
                        $this->doMagicHook();
                }
 
@@ -3795,7 +3795,7 @@ class Language {
                foreach ( $forms as $index => $form ) {
                        if ( preg_match( '/\d+=/i', $form ) ) {
                                $pos = strpos( $form, '=' );
-                               if ( substr( $form, 0, $pos ) === (string) $count ) {
+                               if ( substr( $form, 0, $pos ) === (string)$count ) {
                                        return substr( $form, $pos + 1 );
                                }
                                unset( $forms[$index] );
@@ -4443,7 +4443,7 @@ class Language {
                if ( !isset( $format['avoid'] ) ) {
                        $format['avoid'] = false;
                }
-               if ( !isset( $format['noabbrevs' ] ) ) {
+               if ( !isset( $format['noabbrevs'] ) ) {
                        $format['noabbrevs'] = false;
                }
                $secondsMsg = wfMessage(
index 3836ad9..8682ab0 100644 (file)
@@ -290,17 +290,17 @@ $magicWords = array(
 $linkTrail = '/^([a-zàâçéèêîœôû·’æäåāăëēïīòöōùü‘]+)(.*)$/sDu';
 
 $dateFormats = array(
-    'mdy time' => 'H:i',
-    'mdy date' => 'F j, Y',
-    'mdy both' => 'F j, Y "a" H:i',
+       'mdy time' => 'H:i',
+       'mdy date' => 'F j, Y',
+       'mdy both' => 'F j, Y "a" H:i',
 
-    'dmy time' => 'H:i',
-    'dmy date' => 'j F Y',
-    'dmy both' => 'j F Y "a" H:i',
+       'dmy time' => 'H:i',
+       'dmy date' => 'j F Y',
+       'dmy both' => 'j F Y "a" H:i',
 
-    'ymd time' => 'H:i',
-    'ymd date' => 'Y F j',
-    'ymd both' => 'Y F j "a" H:i',
+       'ymd time' => 'H:i',
+       'ymd date' => 'Y F j',
+       'ymd both' => 'Y F j "a" H:i',
 );
 
 $separatorTransformTable = array( ',' => "\xc2\xa0", '.' => ',' );
index 5d05ca0..e76b9df 100644 (file)
@@ -733,11 +733,11 @@ class ParserTest {
 
                if ( preg_match_all( $regex, $instring, $matches, PREG_SET_ORDER ) ) {
                        foreach ( $matches as $bits ) {
-                               $key = strtolower( $bits[ 'k' ] );
-                               if ( !isset( $bits[ 'v' ] ) ) {
+                               $key = strtolower( $bits['k'] );
+                               if ( !isset( $bits['v'] ) ) {
                                        $opts[$key] = true;
                                } else {
-                                       preg_match_all( $valueregex, $bits[ 'v' ], $vmatches );
+                                       preg_match_all( $valueregex, $bits['v'], $vmatches );
                                        $opts[$key] = array_map( array( $this, 'cleanupOption' ), $vmatches[0] );
                                        if ( count( $opts[$key] ) == 1 ) {
                                                $opts[$key] = $opts[$key][0];
index 9e2f5b8..b2e4459 100644 (file)
@@ -327,7 +327,7 @@ class StatusTest extends MediaWikiLangTestCase {
        public static function provideGetWikiTextAndHtml() {
                $testCases = array();
 
-               $testCases[ 'GoodStatus' ] = array(
+               $testCases['GoodStatus'] = array(
                        new Status(),
                        "Internal error: Status::getWikiText called for a good result, this is incorrect\n",
                        "<p>Internal error: Status::getWikiText called for a good result, this is incorrect\n</p>",
@@ -335,7 +335,7 @@ class StatusTest extends MediaWikiLangTestCase {
 
                $status = new Status();
                $status->ok = false;
-               $testCases[ 'GoodButNoError' ] = array(
+               $testCases['GoodButNoError'] = array(
                        $status,
                        "Internal error: Status::getWikiText: Invalid result object: no error text but not OK\n",
                        "<p>Internal error: Status::getWikiText: Invalid result object: no error text but not OK\n</p>",
@@ -343,7 +343,7 @@ class StatusTest extends MediaWikiLangTestCase {
 
                $status = new Status();
                $status->warning( 'fooBar!' );
-               $testCases[ '1StringWarning' ] = array(
+               $testCases['1StringWarning'] = array(
                        $status,
                        "<fooBar!>",
                        "<p>&lt;fooBar!&gt;\n</p>",
@@ -352,7 +352,7 @@ class StatusTest extends MediaWikiLangTestCase {
                $status = new Status();
                $status->warning( 'fooBar!' );
                $status->warning( 'fooBar2!' );
-               $testCases[ '2StringWarnings' ] = array(
+               $testCases['2StringWarnings'] = array(
                        $status,
                        "* <fooBar!>\n* <fooBar2!>\n",
                        "<ul><li> &lt;fooBar!&gt;</li>\n<li> &lt;fooBar2!&gt;</li></ul>\n",
@@ -360,7 +360,7 @@ class StatusTest extends MediaWikiLangTestCase {
 
                $status = new Status();
                $status->warning( new Message( 'fooBar!', array( 'foo', 'bar' )  ) );
-               $testCases[ '1MessageWarning' ] = array(
+               $testCases['1MessageWarning'] = array(
                        $status,
                        "<fooBar!>",
                        "<p>&lt;fooBar!&gt;\n</p>",
@@ -369,7 +369,7 @@ class StatusTest extends MediaWikiLangTestCase {
                $status = new Status();
                $status->warning( new Message( 'fooBar!', array( 'foo', 'bar' ) ) );
                $status->warning( new Message( 'fooBar2!' ) );
-               $testCases[ '2MessageWarnings' ] = array(
+               $testCases['2MessageWarnings'] = array(
                        $status,
                        "* <fooBar!>\n* <fooBar2!>\n",
                        "<ul><li> &lt;fooBar!&gt;</li>\n<li> &lt;fooBar2!&gt;</li></ul>\n",
@@ -399,7 +399,7 @@ class StatusTest extends MediaWikiLangTestCase {
        public static function provideGetMessage() {
                $testCases = array();
 
-               $testCases[ 'GoodStatus' ] = array(
+               $testCases['GoodStatus'] = array(
                        new Status(),
                        array( "Status::getMessage called for a good result, this is incorrect\n" ),
                        'internalerror_info'
@@ -407,7 +407,7 @@ class StatusTest extends MediaWikiLangTestCase {
 
                $status = new Status();
                $status->ok = false;
-               $testCases[ 'GoodButNoError' ] = array(
+               $testCases['GoodButNoError'] = array(
                        $status,
                        array( "Status::getMessage: Invalid result object: no error text but not OK\n" ),
                        'internalerror_info'
@@ -415,7 +415,7 @@ class StatusTest extends MediaWikiLangTestCase {
 
                $status = new Status();
                $status->warning( 'fooBar!' );
-               $testCases[ '1StringWarning' ] = array(
+               $testCases['1StringWarning'] = array(
                        $status,
                        array(),
                        'fooBar!'
@@ -437,7 +437,7 @@ class StatusTest extends MediaWikiLangTestCase {
 
                $status = new Status();
                $status->warning( new Message( 'fooBar!', array( 'foo', 'bar' )  ) );
-               $testCases[ '1MessageWarning' ] = array(
+               $testCases['1MessageWarning'] = array(
                        $status,
                        array( 'foo', 'bar' ),
                        'fooBar!'
@@ -446,7 +446,7 @@ class StatusTest extends MediaWikiLangTestCase {
                $status = new Status();
                $status->warning( new Message( 'fooBar!', array( 'foo', 'bar' ) ) );
                $status->warning( new Message( 'fooBar2!' ) );
-               $testCases[ '2MessageWarnings' ] = array(
+               $testCases['2MessageWarnings'] = array(
                        $status,
                        array( new Message( 'fooBar!', array( 'foo', 'bar' ) ), new Message( 'fooBar2!' ) ),
                        "* \$1\n* \$2"
index 87ad2cd..0976b1a 100644 (file)
@@ -152,8 +152,8 @@ abstract class ApiTestCase extends MediaWikiLangTestCase {
 
                $data = $this->doApiRequest( array(
                        'action' => 'login',
-                       'lgname' => self::$users[ $user ]->username,
-                       'lgpassword' => self::$users[ $user ]->password ) );
+                       'lgname' => self::$users[$user]->username,
+                       'lgpassword' => self::$users[$user]->password ) );
 
                $token = $data[0]['login']['token'];
 
@@ -161,8 +161,8 @@ abstract class ApiTestCase extends MediaWikiLangTestCase {
                        array(
                                'action' => 'login',
                                'lgtoken' => $token,
-                               'lgname' => self::$users[ $user ]->username,
-                               'lgpassword' => self::$users[ $user ]->password,
+                               'lgname' => self::$users[$user]->username,
+                               'lgpassword' => self::$users[$user]->password,
                        ),
                        $data[2]
                );
index 2eb1c46..dc5dc6a 100644 (file)
@@ -27,7 +27,7 @@ class MWExceptionHandlerTest extends MediaWikiTestCase {
                $hasObject = false;
                $hasArray = false;
                foreach ( $trace as $frame ) {
-                       if ( ! isset( $frame['args'] ) ) {
+                       if ( !isset( $frame['args'] ) ) {
                                continue;
                        }
                        foreach ( $frame['args'] as $arg ) {
@@ -49,7 +49,7 @@ class MWExceptionHandlerTest extends MediaWikiTestCase {
                $redacted = MWExceptionHandler::getRedactedTrace( $e );
 
                foreach ( $redacted as $frame ) {
-                       if ( ! isset( $frame['args'] ) ) {
+                       if ( !isset( $frame['args'] ) ) {
                                continue;
                        }
                        foreach ( $frame['args'] as $arg ) {
index d779207..c0871f1 100644 (file)
@@ -62,7 +62,7 @@ class DjVuTest extends MediaWikiMediaTestCase {
                $file = $this->dataFile( 'LoremIpsum.djvu', 'image/x.djvu' );
                $this->assertEquals(
                        "Lorem ipsum \n1 \n",
-                       (string) $this->handler->getPageText( $file, 1 ),
+                       (string)$this->handler->getPageText( $file, 1 ),
                        "Text layer of page 1 of file LoremIpsum.djvu should be 'Lorem ipsum \n1 \n'"
                );
        }
index 020d436..c09d68c 100644 (file)
@@ -62,4 +62,4 @@ class SpecialMyLanguageTest extends MediaWikiTestCase {
                        array( 'Page/Another', 'Page/Another', 'en', 'es' ),
                );
        }
-}
\ No newline at end of file
+}
index d7742a6..55b2b6b 100644 (file)
@@ -115,7 +115,7 @@ class ResourcesTest extends MediaWikiTestCase {
                                                        $media,
                                                        $file,
                                                        // XXX: Wrapped in an object to keep it out of PHPUnit output
-                                                       (object) array( 'cssText' => $readStyleFile->invoke( $module, $file, $flip ) ),
+                                                       (object)array( 'cssText' => $readStyleFile->invoke( $module, $file, $flip ) ),
                                                );
                                        }
                                }
index 8c24f39..d7342af 100644 (file)
@@ -520,8 +520,8 @@ class TestFileIterator implements Iterator {
 
                                        $this->test = array(
                                                'test' => ParserTest::chomp( $this->sectionData['test'] ),
-                                               'input' => ParserTest::chomp( $this->sectionData[ $input ] ),
-                                               'result' => ParserTest::chomp( $this->sectionData[ $result ] ),
+                                               'input' => ParserTest::chomp( $this->sectionData[$input] ),
+                                               'result' => ParserTest::chomp( $this->sectionData[$result] ),
                                                'options' => ParserTest::chomp( $this->sectionData['options'] ),
                                                'config' => ParserTest::chomp( $this->sectionData['config'] ),
                                        );
@@ -579,7 +579,7 @@ class TestFileIterator implements Iterator {
 
                $data = $this->sectionData;
                $tokens = array_filter( $tokens, function ( $token ) use ( $data ) {
-                       return isset( $data[ $token ] );
+                       return isset( $data[$token] );
                } );
 
                if ( count( $tokens ) == 0 ) {
@@ -605,7 +605,7 @@ class TestFileIterator implements Iterator {
                }
 
                $tokens = array_values( $tokens );
-               return $tokens[ 0 ];
+               return $tokens[0];
        }
 }